﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminCP/Layouts/Admin.Master" AutoEventWireup="true"
    CodeBehind="TaxMananger.aspx.cs" Inherits="MLM.AdminCP.Pages.TaxMananger" meta:resourcekey="PageResource1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Label ID="lbTax" runat="server" Text="Tax Management" 
        meta:resourcekey="lbTaxResource1"></asp:Label>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <telerik:RadGrid ID="RadGroupTaxsGrid" runat="server" AllowFilteringByColumn="True"
        DataSourceID="GroupGroupTaxsEds" AllowPaging="True" AllowSorting="True" GridLines="None"
        ShowGroupPanel="True"  AllowAutomaticInserts="True" AllowAutomaticUpdates="True"
        AllowAutomaticDeletes="True" ShowFooter="True" ShowStatusBar="True" 
        meta:resourcekey="RadGroupTaxsGridResource1">
        <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True">
            <Selecting AllowRowSelect="True" />
            <Scrolling AllowScroll="True" UseStaticHeaders="True" />
            <Selecting AllowRowSelect="True"></Selecting>
            <Scrolling AllowScroll="True" UseStaticHeaders="True"></Scrolling>
        </ClientSettings>
        <MasterTableView AutoGenerateColumns="False" DataKeyNames="RoleID,CountryID" DataSourceID="GroupGroupTaxsEds"
            ShowHeader="true" ShowHeadersWhenNoRecords="true" AllowAutomaticInserts="true"
            CommandItemDisplay="TopAndBottom" AllowFilteringByColumn="false">
            <GroupByExpressions>
                <telerik:GridGroupByExpression>
                    <SelectFields>
                        <telerik:GridGroupByField FieldAlias="Country" FieldName="Country.Name" 
                            SortOrder="Ascending" meta:resourcekey="GridGroupByFieldResource1" />
                    </SelectFields>
                    <GroupByFields>
                        <telerik:GridGroupByField FieldAlias="Country" FieldName="Country.Name" 
                            SortOrder="Ascending" meta:resourcekey="GridGroupByFieldResource2" />
                    </GroupByFields>
                </telerik:GridGroupByExpression>
            </GroupByExpressions>
            <%--<MasterTableView ShowFooter="false" DataKeyNames="ProductID" EditMode="InPlace" CommandItemDisplay="TopAndBottom">--%>
            <CommandItemSettings ShowAddNewRecordButton="true" ShowRefreshButton="true">
                <%--ExportToPdfText="Export to Pdf">--%></CommandItemSettings>
            <RowIndicatorColumn>
                <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>
            <ExpandCollapseColumn>
                <HeaderStyle Width="20px"></HeaderStyle>
            </ExpandCollapseColumn>
            <Columns>
                <telerik:GridBoundColumn DataField="Role.Name" HeaderText="Role" ReadOnly="True"
                    SortExpression="RoleID" UniqueName="RoleID" 
                    meta:resourcekey="GridBoundColumnResource1">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="VAT" HeaderText="VAT (%)" 
                    SortExpression="VAT" UniqueName="VAT" 
                    meta:resourcekey="GridBoundColumnResource2">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="VATSpecial" HeaderText="Special VAT (%)" SortExpression="VATSpecial"
                    UniqueName="VATSpecial" EmptyDataText="Same as VAT" 
                    meta:resourcekey="GridBoundColumnResource3">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Country.Name" HeaderText="Country" ReadOnly="True"
                    SortExpression="CountryID" UniqueName="CountryID" 
                    meta:resourcekey="GridBoundColumnResource4">
                </telerik:GridBoundColumn>
                <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"
                    HeaderText="Edit" meta:resourcekey="GridEditCommandColumnResource1">
                    <ItemStyle CssClass="MyImageButton"></ItemStyle>
                </telerik:GridEditCommandColumn>
                <telerik:GridButtonColumn ConfirmText="Delete this?" ConfirmDialogType="RadWindow"
                    ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                    UniqueName="DeleteColumn" HeaderText="Delete" 
                    meta:resourcekey="GridButtonColumnResource1">
                    <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton"></ItemStyle>
                </telerik:GridButtonColumn>
            </Columns>
            <EditFormSettings EditFormType="Template">
                <EditColumn UniqueName="EditCommandColumn1">
                </EditColumn>
                <FormTemplate>
                    <table id="Table2" style="border-collapse: collapse; padding-left: 20">
                        <tr class="EditFormHeader" style="height: 30">
                            <td style="font-size: small" colspan="2">
                                <b>
                                    <asp:Label ID="Label1" runat="server" Text="Tax Information" 
                                    meta:resourcekey="Label1Resource1"></asp:Label></b>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lbRole" runat="server" Text="Role:" 
                                    meta:resourcekey="lbRoleResource1"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadComboBox CssClass="rancombox" ID="RadComboBox2" runat="server" DataTextField="Name"
                                    DataValueField="RoleID" DataSourceID="GroupRolesEds" EnableLoadOnDemand="True"
                                    SelectedValue='<%# Bind("RoleID") %>' 
                                    meta:resourcekey="RadComboBox2Resource1">
                                </telerik:RadComboBox>
                            </td>
                            <td class="titlename">
                                <asp:Label ID="lbVAT" runat="server" Text="VAT:" 
                                    meta:resourcekey="lbVATResource1"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadNumericTextBox CssClass="radtextbox" ShowSpinButtons="True" ID="RadNumericTextBox1"
                                    runat="server" Text='<%# Bind("VAT") %>' Culture="en-US" LabelCssClass="" 
                                    meta:resourcekey="RadNumericTextBox1Resource1">
                                    <NumberFormat DecimalDigits="2" />
                                </telerik:RadNumericTextBox>%
                                <asp:RequiredFieldValidator ID="NumercTextBoxRequiredFieldValidator" runat="server"
                                    Display="Dynamic" ControlToValidate="RadNumericTextBox1" 
                                    ErrorMessage="Please, select an number!" 
                                    meta:resourcekey="NumercTextBoxRequiredFieldValidatorResource1"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr class="titlename">
                            <td>
                                <asp:Label ID="Label2" runat="server" Text="Country:" 
                                    meta:resourcekey="Label2Resource1"></asp:Label>
                            </td>
                            <td style="width: 30">
                                <telerik:RadComboBox CssClass="rancombox" ID="RadComboBox1" runat="server" DataTextField="Name"
                                    DataValueField="CountryID" DataSourceID="GroupCountryEds" EnableLoadOnDemand="True"
                                    SelectedValue='<%# Bind("CountryID") %>' 
                                    meta:resourcekey="RadComboBox1Resource1">
                                </telerik:RadComboBox>
                            </td>
                            <td class="titlename">
                                <asp:Label ID="Label3" runat="server" Text="Special VAT:" 
                                    meta:resourcekey="Label3Resource1"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadNumericTextBox CssClass="radtextbox" ShowSpinButtons="True" ID="RadNumericTextBox2"
                                    runat="server" Text='<%# Bind("VATSpecial") %>' Culture="en-US" 
                                    LabelCssClass="" meta:resourcekey="RadNumericTextBox2Resource1">
                                    <NumberFormat DecimalDigits="2" />
                                </telerik:RadNumericTextBox>%
                            </td>
                        </tr>
                        <tr>
                            <td style="padding-bottom: 10; padding-top: 10" colspan="2">
                                <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                    runat="server" 
                                    CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' 
                                    meta:resourcekey="btnUpdateResource1">
                                </asp:Button>&nbsp;
                                <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
                                    CommandName="Cancel" meta:resourcekey="btnCancelResource1"></asp:Button>
                            </td>
                        </tr>
                    </table>
                </FormTemplate>
            </EditFormSettings>
        </MasterTableView>
        <%--<HeaderContextMenu EnableImageSprites="True" CssClass="GridContextMenu GridContextMenu_Default">
        </HeaderContextMenu>--%>
        <HeaderContextMenu EnableImageSprites="True" CssClass="GridContextMenu GridContextMenu_Office2007">
        </HeaderContextMenu>
    </telerik:RadGrid>
    <asp:EntityDataSource ID="GroupGroupTaxsEds" runat="server" ConnectionString="name=MLMDataContext"
        DefaultContainerName="MLMDataContext" EnableDelete="True" EnableFlattening="False"
        EnableInsert="True" EnableUpdate="True" EntitySetName="GroupTaxes" 
        Include="Country,Role" EntityTypeFilter="" Select="">
    </asp:EntityDataSource>
    <asp:EntityDataSource ID="GroupCountryEds" runat="server" ConnectionString="name=MLMDataContext"
        DefaultContainerName="MLMDataContext" EnableFlattening="False" EntitySetName="Countries"
        EntityTypeFilter="Country" Select="it.[CountryID], it.[Name]">
    </asp:EntityDataSource>
    <asp:EntityDataSource ID="GroupRolesEds" runat="server" ConnectionString="name=MLMDataContext"
        DefaultContainerName="MLMDataContext" EnableFlattening="False" 
        EntitySetName="Roles" EntityTypeFilter="" Select="">
    </asp:EntityDataSource>
</asp:Content>
